<template>
  <div>
<home-header></home-header><!-- 头部 -->
<home-carouse :list="list"></home-carouse><!--轮播  -->
<home-scenic></home-scenic><!-- 景点 -->
<home-hot :list="hotlist"></home-hot><!-- 本周热点 -->
<home-like :list="likelist"></home-like><!-- 猜你喜欢 -->
<home-weekend :list="weekendlist"></home-weekend>
  </div>
</template>

<script>
// @ is an alias to /src
import HomeHeader from './home/components/Homes.vue'
import HomeCarouse from './home/components/HomeCarousel.vue'
import HomeScenic from './home/components/Scenicspot.vue'
import HomeHot from './home/components/Homehot.vue'
import HomeLike from './home/components/Homelike.vue'
import HomeWeekend from './home/components/Weekend.vue'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    HomeHeader,
    HomeCarouse,
    HomeScenic,
    HomeHot,
    HomeLike,
    HomeWeekend
  },
  data () {
    return {
      list: [],
      hotlist: [],
      likelist: [],
      weekendlist: []
    }
  },
  mounted () {
    axios.get('/lcoaldata/index.json')
      .then((res) => {
        let dataobj = res.data
        let dataList = dataobj.data
        if (dataobj.ret && dataList) {
          this.list = dataList.list
          this.hotlist = dataList.hotlist
          this.likelist = dataList.likelist
          this.weekendlist = dataList.weekendlist
        }
      })
  }
}
</script>
